package com.shujia.base;

import com.shujia.bean.MyCell;
import com.shujia.utils.HBaseUtil;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.util.Bytes;

import java.util.List;
import java.util.Map;

public class HBaseTest {
    public static void main(String[] args) throws Exception{
        Connection connection = HBaseUtil.CONNECTION;
        Admin admin = HBaseUtil.ADMIN;

        System.out.println("数据库连接对象获取成功！！" + connection);
        System.out.println("数据库操作对象获取成功！！" + admin);
        System.out.println("==========================================");

        //创建一张表
//        HBaseUtil.createOneTable("test1","cf1");
//        List<MyCell> data = HBaseUtil.getOneData("users", "rk1003");
//        for (MyCell col : data) {
////            String colName = Bytes.toString(col.getColumnQualifier());
////            String colValue = Bytes.toString(col.getColumnValue());
//            System.out.println(col);
//            System.out.println("--------------");
//        }
        HBaseUtil.scanData("users");


        HBaseUtil.closeSource();


    }

}
